﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Galaxian
{
    //The Structure for Possition
    // i made it public class (gardax)
    public class Position
    {
        //i made this variables public (gardax)
        public int X { get; set; }
        public int Y { get; set; }
        //that's from me (gardax) i need it to complete my class and to help borkata for his class
        public Position(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }

        public static Position operator +(Position a, Position b)
        {
            return new Position(a.X + b.X, a.Y + b.Y);
        }

        public static Position operator -(Position a, Position b)
        {
            return new Position(a.X - b.X, a.Y - b.Y);
        }

        public override bool Equals(object obj)
        {
            Position objPosition = obj as Position;

            return objPosition.X == this.X && objPosition.Y == this.Y;
        }

        public override int GetHashCode()
        {
            return this.X.GetHashCode() * 7 + this.Y;
        }
        //end
    }
}
